<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE MagicHash #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LANGUAGE DeriveFunctor #-}</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Module      :  Text.ParserCombinators.ReadP</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow 2002</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- License     :  BSD-style (see the file libraries/base/LICENSE)</span><span>
</span><span id="line-12"></span><span class="hs-comment">--</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Stability   :  provisional</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- Portability :  non-portable (local universal quantification)</span><span>
</span><span id="line-16"></span><span class="hs-comment">--</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- This is a library of parser combinators, originally written by Koen Claessen.</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- It parses all alternatives in parallel, so it never keeps hold of</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- the beginning of the input string, a common source of space leaks with</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- other parsers.  The @('+++')@ choice combinator is genuinely commutative;</span><span>
</span><span id="line-21"></span><span class="hs-comment">-- it makes no difference which branch is \&quot;shorter\&quot;.</span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Text.ParserCombinators.ReadP</span><span>
</span><span id="line-26"></span><span>  </span><span class="hs-special">(</span><span>
</span><span id="line-27"></span><span>  </span><span class="annot"><span class="hs-comment">-- * The 'ReadP' type</span></span><span>
</span><span id="line-28"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier">ReadP</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span>  </span><span class="annot"><span class="hs-comment">-- * Primitive operations</span></span><span>
</span><span id="line-31"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#get"><span class="hs-identifier">get</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#look"><span class="hs-identifier">look</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#%2B%2B%2B"><span class="hs-operator">(+++)</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#%3C%2B%2B"><span class="hs-operator">(&lt;++)</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#gather"><span class="hs-identifier">gather</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span>  </span><span class="annot"><span class="hs-comment">-- * Other operations</span></span><span>
</span><span id="line-38"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#pfail"><span class="hs-identifier">pfail</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#eof"><span class="hs-identifier">eof</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-40"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#satisfy"><span class="hs-identifier">satisfy</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#char"><span class="hs-identifier">char</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#string"><span class="hs-identifier">string</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#munch"><span class="hs-identifier">munch</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#munch1"><span class="hs-identifier">munch1</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-45"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#skipSpaces"><span class="hs-identifier">skipSpaces</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#choice"><span class="hs-identifier">choice</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-47"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#count"><span class="hs-identifier">count</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-48"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#between"><span class="hs-identifier">between</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#option"><span class="hs-identifier">option</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#optional"><span class="hs-identifier">optional</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-51"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#many"><span class="hs-identifier">many</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-52"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#many1"><span class="hs-identifier">many1</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-53"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#skipMany"><span class="hs-identifier">skipMany</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-54"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#skipMany1"><span class="hs-identifier">skipMany1</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-55"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#sepBy"><span class="hs-identifier">sepBy</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-56"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#sepBy1"><span class="hs-identifier">sepBy1</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-57"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#endBy"><span class="hs-identifier">endBy</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-58"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#endBy1"><span class="hs-identifier">endBy1</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-59"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#chainr"><span class="hs-identifier">chainr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-60"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#chainl"><span class="hs-identifier">chainl</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-61"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#chainl1"><span class="hs-identifier">chainl1</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-62"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#chainr1"><span class="hs-identifier">chainr1</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-63"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#manyTill"><span class="hs-identifier">manyTill</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span><span>  </span><span class="annot"><span class="hs-comment">-- * Running a parser</span></span><span>
</span><span id="line-66"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadS"><span class="hs-identifier">ReadS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-67"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#readP_to_S"><span class="hs-identifier">readP_to_S</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-68"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#readS_to_P"><span class="hs-identifier">readS_to_P</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span>  </span><span class="annot"><span class="hs-comment">-- * Properties</span></span><span>
</span><span id="line-71"></span><span>  </span><span class="annot"><span class="hs-comment">-- $properties</span></span><span>
</span><span id="line-72"></span><span>  </span><span class="hs-special">)</span><span>
</span><span id="line-73"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-74"></span><span>
</span><span id="line-75"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unicode.html"><span class="hs-identifier">GHC.Unicode</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Unicode.html#isSpace"><span class="hs-identifier">isSpace</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.List.html"><span class="hs-identifier">GHC.List</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.List.html#replicate"><span class="hs-identifier">replicate</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.List.html#null"><span class="hs-identifier">null</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-77"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Base.html#many"><span class="hs-identifier">many</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Control.Monad.Fail.html"><span class="hs-identifier">Control.Monad.Fail</span></a></span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">5</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#%2B%2B%2B"><span class="hs-operator hs-type">+++</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#%3C%2B%2B"><span class="hs-operator hs-type">&lt;++</span></a></span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="hs-comment">------------------------------------------------------------------------</span><span>
</span><span id="line-84"></span><span class="hs-comment">-- ReadS</span><span>
</span><span id="line-85"></span><span>
</span><span id="line-86"></span><span class="hs-comment">-- | A parser for a type @a@, represented as a function that takes a</span><span>
</span><span id="line-87"></span><span class="hs-comment">-- 'String' and returns a list of possible parses as @(a,'String')@ pairs.</span><span>
</span><span id="line-88"></span><span class="hs-comment">--</span><span>
</span><span id="line-89"></span><span class="hs-comment">-- Note that this kind of backtracking parser is very inefficient;</span><span>
</span><span id="line-90"></span><span class="hs-comment">-- reading a large structure may be quite slow (cf 'ReadP').</span><span>
</span><span id="line-91"></span><span class="hs-keyword">type</span><span> </span><span id="ReadS"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadS"><span class="hs-identifier hs-var">ReadS</span></a></span></span><span> </span><span id="local-6989586621679488819"><span class="annot"><a href="#local-6989586621679488819"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679488819"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-92"></span><span>
</span><span id="line-93"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-94"></span><span class="hs-comment">-- The P type</span><span>
</span><span id="line-95"></span><span class="hs-comment">-- is representation type -- should be kept abstract</span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span class="hs-keyword">data</span><span> </span><span id="P"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#P"><span class="hs-identifier hs-var">P</span></a></span></span><span> </span><span id="local-6989586621679489018"><span class="annot"><a href="#local-6989586621679489018"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-98"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="Get"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Get"><span class="hs-identifier hs-var">Get</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679489018"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-99"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Look"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-var">Look</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679489018"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-100"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Fail"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span></span><span>
</span><span id="line-101"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Result"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Result"><span class="hs-identifier hs-var">Result</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679489018"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679489018"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-102"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Final"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-var">Final</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679489018"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-103"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span id="local-6989586621679488804"><span id="local-6989586621679488812"><span class="annot"><span class="annottext">(forall a b. (a -&gt; b) -&gt; P a -&gt; P b)
-&gt; (forall a b. a -&gt; P b -&gt; P a) -&gt; Functor P
forall a b. a -&gt; P b -&gt; P a
forall a b. (a -&gt; b) -&gt; P a -&gt; P b
forall (f :: * -&gt; *).
(forall a b. (a -&gt; b) -&gt; f a -&gt; f b)
-&gt; (forall a b. a -&gt; f b -&gt; f a) -&gt; Functor f
&lt;$ :: forall a b. a -&gt; P b -&gt; P a
$c&lt;$ :: forall a b. a -&gt; P b -&gt; P a
fmap :: forall a b. (a -&gt; b) -&gt; P a -&gt; P b
$cfmap :: forall a b. (a -&gt; b) -&gt; P a -&gt; P b
</span><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Functor</span></a></span></span></span><span> </span><span class="hs-comment">-- ^ @since 4.8.0.0</span><span>
</span><span id="line-104"></span><span>
</span><span id="line-105"></span><span class="hs-comment">-- Monad, MonadPlus</span><span>
</span><span id="line-106"></span><span>
</span><span id="line-107"></span><span class="hs-comment">-- | @since 4.5.0.0</span><span>
</span><span id="line-108"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679488789"><span id="local-6989586621679488791"><span id="local-6989586621679488793"><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#P"><span class="hs-identifier hs-type">P</span></a></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-109"></span><span>  </span><span id="local-6989586621679488787"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; P a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621679488786"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488786"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; P a -&gt; P a
forall a. a -&gt; P a -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Result"><span class="hs-identifier hs-var">Result</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488786"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">P a
forall a. P a
</span><a href="Text.ParserCombinators.ReadP.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span>
</span><span id="line-110"></span><span>  </span><span id="local-6989586621679488784"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. P (a -&gt; b) -&gt; P a -&gt; P b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;*&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">P (a -&gt; b) -&gt; P a -&gt; P b
forall (m :: * -&gt; *) a b. Monad m =&gt; m (a -&gt; b) -&gt; m a -&gt; m b
</span><a href="GHC.Base.html#ap"><span class="hs-identifier hs-var">ap</span></a></span><span>
</span><span id="line-111"></span><span>
</span><span id="line-112"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-113"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679488775"><span id="local-6989586621679488777"><span class="annot"><a href="GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#P"><span class="hs-identifier hs-type">P</span></a></span></span></span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-116"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679488767"><span id="local-6989586621679488769"><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#P"><span class="hs-identifier hs-type">P</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-117"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span id="local-6989586621679488761"><span class="annot"><span class="annottext">Char -&gt; P a
</span><a href="#local-6989586621679488761"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span>         </span><span id="local-6989586621679488760"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. P a -&gt; (a -&gt; P b) -&gt; P b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679488759"><span class="annot"><span class="annottext">a -&gt; P b
</span><a href="#local-6989586621679488759"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; P b) -&gt; P b
forall a. (Char -&gt; P a) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Get"><span class="hs-identifier hs-var">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488758"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488758"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Char -&gt; P a
</span><a href="#local-6989586621679488761"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488758"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">P a -&gt; (a -&gt; P b) -&gt; P b
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; P b
</span><a href="#local-6989586621679488759"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-118"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-type">Look</span></a></span><span> </span><span id="local-6989586621679488757"><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488757"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="annot"><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span id="local-6989586621679488756"><span class="annot"><span class="annottext">a -&gt; P b
</span><a href="#local-6989586621679488756"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; P b) -&gt; P b
forall a. (String -&gt; P a) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-var">Look</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488755"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488755"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488757"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488755"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">P a -&gt; (a -&gt; P b) -&gt; P b
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; P b
</span><a href="#local-6989586621679488756"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-119"></span><span>  </span><span class="annot"><span class="annottext">P a
</span><a href="Text.ParserCombinators.ReadP.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span>            </span><span class="annot"><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; P b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">P b
forall a. P a
</span><a href="Text.ParserCombinators.ReadP.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span>
</span><span id="line-120"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Result"><span class="hs-identifier hs-type">Result</span></a></span><span> </span><span id="local-6989586621679488754"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488754"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679488753"><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488753"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="annot"><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span id="local-6989586621679488752"><span class="annot"><span class="annottext">a -&gt; P b
</span><a href="#local-6989586621679488752"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; P b
</span><a href="#local-6989586621679488752"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488754"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">P b -&gt; P b -&gt; P b
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488753"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">P a -&gt; (a -&gt; P b) -&gt; P b
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; P b
</span><a href="#local-6989586621679488752"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-121"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-type">Final</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679488750"><span class="annot"><span class="annottext">(a, String)
</span><a href="#local-6989586621679488750"><span class="hs-identifier hs-var">r</span></a></span></span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span id="local-6989586621679488748"><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679488748"><span class="hs-identifier hs-var">rs</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span id="local-6989586621679488747"><span class="annot"><span class="annottext">a -&gt; P b
</span><a href="#local-6989586621679488747"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(b, String)] -&gt; P b
forall a. [(a, String)] -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#final"><span class="hs-identifier hs-var">final</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">(b, String)
</span><a href="#local-6989586621679488745"><span class="hs-identifier hs-var">ys'</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679488744"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488744"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679488743"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488743"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a, String)
</span><a href="#local-6989586621679488750"><span class="hs-identifier hs-var">r</span></a></span><span class="annot"><span class="annottext">(a, String) -&gt; [(a, String)] -&gt; [(a, String)]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679488748"><span class="hs-identifier hs-var">rs</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621679488745"><span class="annot"><span class="annottext">(b, String)
</span><a href="#local-6989586621679488745"><span class="hs-identifier hs-var">ys'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">P b -&gt; ReadS b
forall a. P a -&gt; ReadS a
</span><a href="Text.ParserCombinators.ReadP.html#run"><span class="hs-identifier hs-var">run</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; P b
</span><a href="#local-6989586621679488747"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488744"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488743"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-122"></span><span>
</span><span id="line-123"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-124"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Fail.html#MonadFail"><span class="hs-identifier hs-type">MonadFail</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-125"></span><span>  </span><span id="local-6989586621679488736"><span class="annot"><span class="annottext">fail :: forall a. String -&gt; P a
</span><a href="Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var hs-var hs-var hs-var">fail</span></a></span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">P a
forall a. P a
</span><a href="Text.ParserCombinators.ReadP.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span>
</span><span id="line-126"></span><span>
</span><span id="line-127"></span><span class="hs-comment">-- | @since 4.5.0.0</span><span>
</span><span id="line-128"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679488728"><span id="local-6989586621679488730"><span class="annot"><a href="GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#P"><span class="hs-identifier hs-type">P</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-129"></span><span>  </span><span id="local-6989586621679488726"><span class="annot"><span class="annottext">empty :: forall a. P a
</span><a href="GHC.Base.html#empty"><span class="hs-identifier hs-var hs-var hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">P a
forall a. P a
</span><a href="Text.ParserCombinators.ReadP.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span>
</span><span id="line-130"></span><span>
</span><span id="line-131"></span><span>  </span><span class="hs-comment">-- most common case: two gets are combined</span><span>
</span><span id="line-132"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span id="local-6989586621679488714"><span class="annot"><span class="annottext">Char -&gt; P a
</span><a href="#local-6989586621679488714"><span class="hs-identifier hs-var">f1</span></a></span></span><span>     </span><span id="local-6989586621679488713"><span class="annot"><span class="annottext">&lt;|&gt; :: forall a. P a -&gt; P a -&gt; P a
</span><a href="#local-6989586621679488713"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;|&gt;</span></a></span></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span id="local-6989586621679488712"><span class="annot"><span class="annottext">Char -&gt; P a
</span><a href="#local-6989586621679488712"><span class="hs-identifier hs-var">f2</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; P a) -&gt; P a
forall a. (Char -&gt; P a) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Get"><span class="hs-identifier hs-var">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488711"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488711"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Char -&gt; P a
</span><a href="#local-6989586621679488714"><span class="hs-identifier hs-var">f1</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488711"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">P a -&gt; P a -&gt; P a
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; P a
</span><a href="#local-6989586621679488712"><span class="hs-identifier hs-var">f2</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488711"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-133"></span><span>
</span><span id="line-134"></span><span>  </span><span class="hs-comment">-- results are delivered as soon as possible</span><span>
</span><span id="line-135"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Result"><span class="hs-identifier hs-type">Result</span></a></span><span> </span><span id="local-6989586621679488710"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488710"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679488709"><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488709"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span id="local-6989586621679488708"><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488708"><span class="hs-identifier hs-var">q</span></a></span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; P a -&gt; P a
forall a. a -&gt; P a -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Result"><span class="hs-identifier hs-var">Result</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488710"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488709"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">P a -&gt; P a -&gt; P a
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488708"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-136"></span><span>  </span><span id="local-6989586621679488707"><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488707"><span class="hs-identifier hs-var">p</span></a></span></span><span>          </span><span class="annot"><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Result"><span class="hs-identifier hs-type">Result</span></a></span><span> </span><span id="local-6989586621679488706"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488706"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679488705"><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488705"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; P a -&gt; P a
forall a. a -&gt; P a -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Result"><span class="hs-identifier hs-var">Result</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488706"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488707"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">P a -&gt; P a -&gt; P a
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488705"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span>  </span><span class="hs-comment">-- fail disappears</span><span>
</span><span id="line-139"></span><span>  </span><span class="annot"><span class="annottext">P a
</span><a href="Text.ParserCombinators.ReadP.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span>       </span><span class="annot"><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span id="local-6989586621679488704"><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488704"><span class="hs-identifier hs-var">p</span></a></span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488704"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-140"></span><span>  </span><span id="local-6989586621679488703"><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488703"><span class="hs-identifier hs-var">p</span></a></span></span><span>          </span><span class="annot"><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">P a
</span><a href="Text.ParserCombinators.ReadP.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488703"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span>  </span><span class="hs-comment">-- two finals are combined</span><span>
</span><span id="line-143"></span><span>  </span><span class="hs-comment">-- final + look becomes one look and one final (=optimization)</span><span>
</span><span id="line-144"></span><span>  </span><span class="hs-comment">-- final + sthg else becomes one look and one final</span><span>
</span><span id="line-145"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-type">Final</span></a></span><span> </span><span id="local-6989586621679488702"><span class="annot"><span class="annottext">NonEmpty (a, String)
</span><a href="#local-6989586621679488702"><span class="hs-identifier hs-var">r</span></a></span></span><span>       </span><span class="annot"><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-type">Final</span></a></span><span> </span><span id="local-6989586621679488701"><span class="annot"><span class="annottext">NonEmpty (a, String)
</span><a href="#local-6989586621679488701"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NonEmpty (a, String) -&gt; P a
forall a. NonEmpty (a, String) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-var">Final</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NonEmpty (a, String)
</span><a href="#local-6989586621679488702"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (a, String)
-&gt; NonEmpty (a, String) -&gt; NonEmpty (a, String)
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (a, String)
</span><a href="#local-6989586621679488701"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-type">Final</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679488700"><span class="annot"><span class="annottext">(a, String)
</span><a href="#local-6989586621679488700"><span class="hs-identifier hs-var">r</span></a></span></span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span id="local-6989586621679488699"><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679488699"><span class="hs-identifier hs-var">rs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-type">Look</span></a></span><span> </span><span id="local-6989586621679488698"><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488698"><span class="hs-identifier hs-var">f</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; P a) -&gt; P a
forall a. (String -&gt; P a) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-var">Look</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488697"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488697"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty (a, String) -&gt; P a
forall a. NonEmpty (a, String) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-var">Final</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a, String)
</span><a href="#local-6989586621679488700"><span class="hs-identifier hs-var">r</span></a></span><span class="annot"><span class="annottext">(a, String) -&gt; [(a, String)] -&gt; NonEmpty (a, String)
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679488699"><span class="hs-identifier hs-var">rs</span></a></span><span> </span><span class="annot"><span class="annottext">[(a, String)] -&gt; [(a, String)] -&gt; [(a, String)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">P a -&gt; ReadS a
forall a. P a -&gt; ReadS a
</span><a href="Text.ParserCombinators.ReadP.html#run"><span class="hs-identifier hs-var">run</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488698"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488697"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488697"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-147"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-type">Final</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679488696"><span class="annot"><span class="annottext">(a, String)
</span><a href="#local-6989586621679488696"><span class="hs-identifier hs-var">r</span></a></span></span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span id="local-6989586621679488695"><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679488695"><span class="hs-identifier hs-var">rs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span id="local-6989586621679488694"><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488694"><span class="hs-identifier hs-var">p</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; P a) -&gt; P a
forall a. (String -&gt; P a) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-var">Look</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488693"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488693"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty (a, String) -&gt; P a
forall a. NonEmpty (a, String) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-var">Final</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a, String)
</span><a href="#local-6989586621679488696"><span class="hs-identifier hs-var">r</span></a></span><span class="annot"><span class="annottext">(a, String) -&gt; [(a, String)] -&gt; NonEmpty (a, String)
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679488695"><span class="hs-identifier hs-var">rs</span></a></span><span> </span><span class="annot"><span class="annottext">[(a, String)] -&gt; [(a, String)] -&gt; [(a, String)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">P a -&gt; ReadS a
forall a. P a -&gt; ReadS a
</span><a href="Text.ParserCombinators.ReadP.html#run"><span class="hs-identifier hs-var">run</span></a></span><span> </span><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488694"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488693"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-148"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-type">Look</span></a></span><span> </span><span id="local-6989586621679488692"><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488692"><span class="hs-identifier hs-var">f</span></a></span></span><span>        </span><span class="annot"><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-type">Final</span></a></span><span> </span><span id="local-6989586621679488691"><span class="annot"><span class="annottext">NonEmpty (a, String)
</span><a href="#local-6989586621679488691"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; P a) -&gt; P a
forall a. (String -&gt; P a) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-var">Look</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488690"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488690"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty (a, String) -&gt; P a
forall a. NonEmpty (a, String) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-var">Final</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">P a -&gt; ReadS a
forall a. P a -&gt; ReadS a
</span><a href="Text.ParserCombinators.ReadP.html#run"><span class="hs-identifier hs-var">run</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488692"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488690"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488690"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-149"></span><span>                                </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty (a, String)
</span><a href="#local-6989586621679488691"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-150"></span><span>                                </span><span class="hs-special">(</span><span id="local-6989586621679488689"><span class="annot"><span class="annottext">(a, String)
</span><a href="#local-6989586621679488689"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679488688"><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679488688"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a, String)
</span><a href="#local-6989586621679488689"><span class="hs-identifier hs-var">x</span></a></span><span class="annot"><span class="annottext">(a, String) -&gt; [(a, String)] -&gt; NonEmpty (a, String)
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679488688"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">NonEmpty (a, String)
-&gt; NonEmpty (a, String) -&gt; NonEmpty (a, String)
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (a, String)
</span><a href="#local-6989586621679488691"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-151"></span><span>  </span><span id="local-6989586621679488687"><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488687"><span class="hs-identifier hs-var">p</span></a></span></span><span>             </span><span class="annot"><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-type">Final</span></a></span><span> </span><span id="local-6989586621679488686"><span class="annot"><span class="annottext">NonEmpty (a, String)
</span><a href="#local-6989586621679488686"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; P a) -&gt; P a
forall a. (String -&gt; P a) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-var">Look</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488685"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488685"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty (a, String) -&gt; P a
forall a. NonEmpty (a, String) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-var">Final</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">P a -&gt; ReadS a
forall a. P a -&gt; ReadS a
</span><a href="Text.ParserCombinators.ReadP.html#run"><span class="hs-identifier hs-var">run</span></a></span><span> </span><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488687"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488685"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-152"></span><span>                                </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty (a, String)
</span><a href="#local-6989586621679488686"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-153"></span><span>                                </span><span class="hs-special">(</span><span id="local-6989586621679488684"><span class="annot"><span class="annottext">(a, String)
</span><a href="#local-6989586621679488684"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679488683"><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679488683"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a, String)
</span><a href="#local-6989586621679488684"><span class="hs-identifier hs-var">x</span></a></span><span class="annot"><span class="annottext">(a, String) -&gt; [(a, String)] -&gt; NonEmpty (a, String)
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679488683"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">NonEmpty (a, String)
-&gt; NonEmpty (a, String) -&gt; NonEmpty (a, String)
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (a, String)
</span><a href="#local-6989586621679488686"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-154"></span><span>
</span><span id="line-155"></span><span>  </span><span class="hs-comment">-- two looks are combined (=optimization)</span><span>
</span><span id="line-156"></span><span>  </span><span class="hs-comment">-- look + sthg else floats upwards</span><span>
</span><span id="line-157"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-type">Look</span></a></span><span> </span><span id="local-6989586621679488682"><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488682"><span class="hs-identifier hs-var">f</span></a></span></span><span>     </span><span class="annot"><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-type">Look</span></a></span><span> </span><span id="local-6989586621679488681"><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488681"><span class="hs-identifier hs-var">g</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; P a) -&gt; P a
forall a. (String -&gt; P a) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-var">Look</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488680"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488680"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488682"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488680"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">P a -&gt; P a -&gt; P a
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488681"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488680"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-158"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-type">Look</span></a></span><span> </span><span id="local-6989586621679488679"><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488679"><span class="hs-identifier hs-var">f</span></a></span></span><span>     </span><span class="annot"><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span id="local-6989586621679488678"><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488678"><span class="hs-identifier hs-var">p</span></a></span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; P a) -&gt; P a
forall a. (String -&gt; P a) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-var">Look</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488677"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488677"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488679"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488677"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">P a -&gt; P a -&gt; P a
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488678"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-159"></span><span>  </span><span id="local-6989586621679488676"><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488676"><span class="hs-identifier hs-var">p</span></a></span></span><span>          </span><span class="annot"><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-type">Look</span></a></span><span> </span><span id="local-6989586621679488675"><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488675"><span class="hs-identifier hs-var">f</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; P a) -&gt; P a
forall a. (String -&gt; P a) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-var">Look</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488674"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488674"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488676"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">P a -&gt; P a -&gt; P a
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488675"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488674"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-160"></span><span>
</span><span id="line-161"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-162"></span><span class="hs-comment">-- The ReadP type</span><span>
</span><span id="line-163"></span><span>
</span><span id="line-164"></span><span class="hs-keyword">newtype</span><span> </span><span id="ReadP"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-var">ReadP</span></a></span></span><span> </span><span id="local-6989586621679488981"><span class="annot"><a href="#local-6989586621679488981"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="R"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-var">R</span></a></span></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679488982"><span class="annot"><a href="#local-6989586621679488982"><span class="hs-identifier hs-type">b</span></a></span></span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679488981"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488982"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488982"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-165"></span><span>
</span><span id="line-166"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-167"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679488670"><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-168"></span><span>  </span><span id="local-6989586621679488669"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; ReadP a -&gt; ReadP b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679488668"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679488668"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-type">R</span></a></span><span> </span><span id="local-6989586621679488667"><span class="annot"><span class="annottext">forall b. (a -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488667"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b. (b -&gt; P b) -&gt; P b) -&gt; ReadP b
forall a. (forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-var">R</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488666"><span class="annot"><span class="annottext">b -&gt; P b
</span><a href="#local-6989586621679488666"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(a -&gt; P b) -&gt; P b
forall b. (a -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488667"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; P b
</span><a href="#local-6989586621679488666"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; P b) -&gt; (a -&gt; b) -&gt; a -&gt; P b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679488668"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-169"></span><span>
</span><span id="line-170"></span><span class="hs-comment">-- | @since 4.6.0.0</span><span>
</span><span id="line-171"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679488655"><span id="local-6989586621679488657"><span id="local-6989586621679488659"><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-172"></span><span>    </span><span id="local-6989586621679488654"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; ReadP a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621679488653"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488653"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
forall a. (forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-var">R</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488652"><span class="annot"><span class="annottext">a -&gt; P b
</span><a href="#local-6989586621679488652"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; P b
</span><a href="#local-6989586621679488652"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488653"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-173"></span><span>    </span><span id="local-6989586621679488650"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. ReadP (a -&gt; b) -&gt; ReadP a -&gt; ReadP b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;*&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP (a -&gt; b) -&gt; ReadP a -&gt; ReadP b
forall (m :: * -&gt; *) a b. Monad m =&gt; m (a -&gt; b) -&gt; m a -&gt; m b
</span><a href="GHC.Base.html#ap"><span class="hs-identifier hs-var">ap</span></a></span><span>
</span><span id="line-174"></span><span>    </span><span class="hs-comment">-- liftA2 = liftM2</span><span>
</span><span id="line-175"></span><span>
</span><span id="line-176"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-177"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679488643"><span id="local-6989586621679488645"><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-178"></span><span>  </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-type">R</span></a></span><span> </span><span id="local-6989586621679488642"><span class="annot"><span class="annottext">forall b. (a -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488642"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679488641"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. ReadP a -&gt; (a -&gt; ReadP b) -&gt; ReadP b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679488640"><span class="annot"><span class="annottext">a -&gt; ReadP b
</span><a href="#local-6989586621679488640"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b. (b -&gt; P b) -&gt; P b) -&gt; ReadP b
forall a. (forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-var">R</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488639"><span class="annot"><span class="annottext">b -&gt; P b
</span><a href="#local-6989586621679488639"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(a -&gt; P b) -&gt; P b
forall b. (a -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488642"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488638"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488638"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-type">R</span></a></span><span> </span><span id="local-6989586621679488637"><span class="annot"><span class="annottext">forall b. (b -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488637"><span class="hs-identifier hs-var">m'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; ReadP b
</span><a href="#local-6989586621679488640"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488638"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">(b -&gt; P b) -&gt; P b
forall b. (b -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488637"><span class="hs-identifier hs-var">m'</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; P b
</span><a href="#local-6989586621679488639"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-179"></span><span>
</span><span id="line-180"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-181"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Fail.html#MonadFail"><span class="hs-identifier hs-type">MonadFail</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-182"></span><span>  </span><span id="local-6989586621679488632"><span class="annot"><span class="annottext">fail :: forall a. String -&gt; ReadP a
</span><a href="Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var hs-var hs-var hs-var">fail</span></a></span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
forall a. (forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-var">R</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">a -&gt; P b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">P b
forall a. P a
</span><a href="Text.ParserCombinators.ReadP.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-183"></span><span>
</span><span id="line-184"></span><span class="hs-comment">-- | @since 4.6.0.0</span><span>
</span><span id="line-185"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679488624"><span id="local-6989586621679488626"><span class="annot"><a href="GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-186"></span><span>  </span><span id="local-6989586621679488623"><span class="annot"><span class="annottext">empty :: forall a. ReadP a
</span><a href="#local-6989586621679488623"><span class="hs-identifier hs-var hs-var hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a
forall a. ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#pfail"><span class="hs-identifier hs-var">pfail</span></a></span><span>
</span><span id="line-187"></span><span>  </span><span id="local-6989586621679488622"><span class="annot"><span class="annottext">&lt;|&gt; :: forall a. ReadP a -&gt; ReadP a -&gt; ReadP a
</span><a href="#local-6989586621679488622"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;|&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP a -&gt; ReadP a
forall a. ReadP a -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#%2B%2B%2B"><span class="hs-operator hs-var">(+++)</span></a></span><span>
</span><span id="line-188"></span><span>
</span><span id="line-189"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-190"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679488614"><span id="local-6989586621679488616"><span class="annot"><a href="GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span></span></span><span>
</span><span id="line-191"></span><span>
</span><span id="line-192"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-193"></span><span class="hs-comment">-- Operations over P</span><span>
</span><span id="line-194"></span><span>
</span><span id="line-195"></span><span id="local-6989586621679488999"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#final"><span class="hs-identifier hs-type">final</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679488999"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488999"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-196"></span><span id="final"><span class="annot"><span class="annottext">final :: forall a. [(a, String)] -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#final"><span class="hs-identifier hs-var hs-var">final</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">P a
forall a. P a
</span><a href="Text.ParserCombinators.ReadP.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span>
</span><span id="line-197"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#final"><span class="hs-identifier hs-var">final</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679488613"><span class="annot"><span class="annottext">(a, String)
</span><a href="#local-6989586621679488613"><span class="hs-identifier hs-var">r</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679488612"><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679488612"><span class="hs-identifier hs-var">rs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NonEmpty (a, String) -&gt; P a
forall a. NonEmpty (a, String) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-var">Final</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a, String)
</span><a href="#local-6989586621679488613"><span class="hs-identifier hs-var">r</span></a></span><span class="annot"><span class="annottext">(a, String) -&gt; [(a, String)] -&gt; NonEmpty (a, String)
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679488612"><span class="hs-identifier hs-var">rs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-198"></span><span>
</span><span id="line-199"></span><span id="local-6989586621679488996"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#run"><span class="hs-identifier hs-type">run</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488996"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadS"><span class="hs-identifier hs-type">ReadS</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488996"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-200"></span><span id="run"><span class="annot"><span class="annottext">run :: forall a. P a -&gt; ReadS a
</span><a href="Text.ParserCombinators.ReadP.html#run"><span class="hs-identifier hs-var hs-var">run</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span id="local-6989586621679488611"><span class="annot"><span class="annottext">Char -&gt; P a
</span><a href="#local-6989586621679488611"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span>         </span><span class="hs-special">(</span><span id="local-6989586621679488610"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488610"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679488609"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488609"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">P a -&gt; ReadS a
forall a. P a -&gt; ReadS a
</span><a href="Text.ParserCombinators.ReadP.html#run"><span class="hs-identifier hs-var">run</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; P a
</span><a href="#local-6989586621679488611"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488610"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488609"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-201"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#run"><span class="hs-identifier hs-var">run</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-type">Look</span></a></span><span> </span><span id="local-6989586621679488608"><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488608"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span>        </span><span id="local-6989586621679488607"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488607"><span class="hs-identifier hs-var">s</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">P a -&gt; ReadS a
forall a. P a -&gt; ReadS a
</span><a href="Text.ParserCombinators.ReadP.html#run"><span class="hs-identifier hs-var">run</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488608"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488607"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488607"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-202"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#run"><span class="hs-identifier hs-var">run</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Result"><span class="hs-identifier hs-type">Result</span></a></span><span> </span><span id="local-6989586621679488606"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488606"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679488605"><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488605"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>    </span><span id="local-6989586621679488604"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488604"><span class="hs-identifier hs-var">s</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488606"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488604"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(a, String) -&gt; [(a, String)] -&gt; [(a, String)]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">P a -&gt; ReadS a
forall a. P a -&gt; ReadS a
</span><a href="Text.ParserCombinators.ReadP.html#run"><span class="hs-identifier hs-var">run</span></a></span><span> </span><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488605"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488604"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-203"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#run"><span class="hs-identifier hs-var">run</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-type">Final</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679488603"><span class="annot"><span class="annottext">(a, String)
</span><a href="#local-6989586621679488603"><span class="hs-identifier hs-var">r</span></a></span></span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span id="local-6989586621679488602"><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679488602"><span class="hs-identifier hs-var">rs</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a, String)
</span><a href="#local-6989586621679488603"><span class="hs-identifier hs-var">r</span></a></span><span class="annot"><span class="annottext">(a, String) -&gt; [(a, String)] -&gt; [(a, String)]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">[(a, String)]
</span><a href="#local-6989586621679488602"><span class="hs-identifier hs-var">rs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-204"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#run"><span class="hs-identifier hs-var">run</span></a></span><span> </span><span class="annot"><span class="annottext">P a
</span><span class="hs-identifier">_</span></span><span>               </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-205"></span><span>
</span><span id="line-206"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-207"></span><span class="hs-comment">-- Operations over ReadP</span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#get"><span class="hs-identifier hs-type">get</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-210"></span><span class="hs-comment">-- ^ Consumes and returns the next character.</span><span>
</span><span id="line-211"></span><span class="hs-comment">--   Fails if there is no input left.</span><span>
</span><span id="line-212"></span><span id="get"><span class="annot"><span class="annottext">get :: ReadP Char
</span><a href="Text.ParserCombinators.ReadP.html#get"><span class="hs-identifier hs-var hs-var">get</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall a. (Char -&gt; P a) -&gt; P a) -&gt; ReadP Char
forall a. (forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-var">R</span></a></span><span> </span><span class="annot"><span class="annottext">forall a. (Char -&gt; P a) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Get"><span class="hs-identifier hs-var">Get</span></a></span><span>
</span><span id="line-213"></span><span>
</span><span id="line-214"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#look"><span class="hs-identifier hs-type">look</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-215"></span><span class="hs-comment">-- ^ Look-ahead: returns the part of the input that is left, without</span><span>
</span><span id="line-216"></span><span class="hs-comment">--   consuming it.</span><span>
</span><span id="line-217"></span><span id="look"><span class="annot"><span class="annottext">look :: ReadP String
</span><a href="Text.ParserCombinators.ReadP.html#look"><span class="hs-identifier hs-var hs-var">look</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall a. (String -&gt; P a) -&gt; P a) -&gt; ReadP String
forall a. (forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-var">R</span></a></span><span> </span><span class="annot"><span class="annottext">forall a. (String -&gt; P a) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-var">Look</span></a></span><span>
</span><span id="line-218"></span><span>
</span><span id="line-219"></span><span id="local-6989586621679488601"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#pfail"><span class="hs-identifier hs-type">pfail</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488601"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-220"></span><span class="hs-comment">-- ^ Always fails.</span><span>
</span><span id="line-221"></span><span id="pfail"><span class="annot"><span class="annottext">pfail :: forall a. ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#pfail"><span class="hs-identifier hs-var hs-var">pfail</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
forall a. (forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-var">R</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">a -&gt; P b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">P b
forall a. P a
</span><a href="Text.ParserCombinators.ReadP.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-222"></span><span>
</span><span id="line-223"></span><span id="local-6989586621679488600"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#%2B%2B%2B"><span class="hs-operator hs-type">(+++)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488600"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488600"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488600"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-224"></span><span class="hs-comment">-- ^ Symmetric choice.</span><span>
</span><span id="line-225"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-type">R</span></a></span><span> </span><span id="local-6989586621679488599"><span class="annot"><span class="annottext">forall b. (a -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488599"><span class="hs-identifier hs-var">f1</span></a></span></span><span> </span><span id="%2B%2B%2B"><span class="annot"><span class="annottext">+++ :: forall a. ReadP a -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#%2B%2B%2B"><span class="hs-operator hs-var hs-var">+++</span></a></span></span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-type">R</span></a></span><span> </span><span id="local-6989586621679488598"><span class="annot"><span class="annottext">forall b. (a -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488598"><span class="hs-identifier hs-var">f2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
forall a. (forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-var">R</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488596"><span class="annot"><span class="annottext">a -&gt; P b
</span><a href="#local-6989586621679488596"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(a -&gt; P b) -&gt; P b
forall b. (a -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488599"><span class="hs-identifier hs-var">f1</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; P b
</span><a href="#local-6989586621679488596"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">P b -&gt; P b -&gt; P b
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; P b) -&gt; P b
forall b. (a -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488598"><span class="hs-identifier hs-var">f2</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; P b
</span><a href="#local-6989586621679488596"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-226"></span><span>
</span><span id="line-227"></span><span id="local-6989586621679488595"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#%3C%2B%2B"><span class="hs-operator hs-type">(&lt;++)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488595"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488595"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488595"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-228"></span><span class="hs-comment">-- ^ Local, exclusive, left-biased choice: If left parser</span><span>
</span><span id="line-229"></span><span class="hs-comment">--   locally produces any result at all, then right parser is</span><span>
</span><span id="line-230"></span><span class="hs-comment">--   not used.</span><span>
</span><span id="line-231"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-type">R</span></a></span><span> </span><span id="local-6989586621679488592"><span class="annot"><span class="annottext">forall b. (a -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488592"><span class="hs-identifier hs-var">f0</span></a></span></span><span> </span><span id="%3C%2B%2B"><span class="annot"><span class="annottext">&lt;++ :: forall a. ReadP a -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#%3C%2B%2B"><span class="hs-operator hs-var hs-var">&lt;++</span></a></span></span><span> </span><span id="local-6989586621679488591"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488591"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-232"></span><span>  </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679488590"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488590"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP String
</span><a href="Text.ParserCombinators.ReadP.html#look"><span class="hs-identifier hs-var">look</span></a></span><span>
</span><span id="line-233"></span><span>     </span><span class="annot"><span class="annottext">P a -&gt; String -&gt; Int# -&gt; ReadP a
</span><a href="#local-6989586621679488589"><span class="hs-identifier hs-var">probe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; P a) -&gt; P a
forall b. (a -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488592"><span class="hs-identifier hs-var">f0</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; P a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488590"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span>
</span><span id="line-234"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-235"></span><span>  </span><span id="local-6989586621679488589"><span class="annot"><span class="annottext">probe :: P a -&gt; String -&gt; Int# -&gt; ReadP a
</span><a href="#local-6989586621679488589"><span class="hs-identifier hs-var hs-var">probe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span id="local-6989586621679488587"><span class="annot"><span class="annottext">Char -&gt; P a
</span><a href="#local-6989586621679488587"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679488586"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488586"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679488585"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488585"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679488584"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679488584"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">P a -&gt; String -&gt; Int# -&gt; ReadP a
</span><a href="#local-6989586621679488589"><span class="hs-identifier hs-var">probe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; P a
</span><a href="#local-6989586621679488587"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488586"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488585"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679488584"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%2B%23"><span class="hs-operator hs-var">+#</span></a></span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span class="hs-special">)</span><span>
</span><span id="line-236"></span><span>  </span><span class="annot"><a href="#local-6989586621679488589"><span class="hs-identifier hs-var">probe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-type">Look</span></a></span><span> </span><span id="local-6989586621679488583"><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488583"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span>       </span><span id="local-6989586621679488582"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488582"><span class="hs-identifier hs-var">s</span></a></span></span><span>     </span><span id="local-6989586621679488581"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679488581"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">P a -&gt; String -&gt; Int# -&gt; ReadP a
</span><a href="#local-6989586621679488589"><span class="hs-identifier hs-var">probe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; P a
</span><a href="#local-6989586621679488583"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488582"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488582"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679488581"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-237"></span><span>  </span><span class="annot"><a href="#local-6989586621679488589"><span class="hs-identifier hs-var">probe</span></a></span><span> </span><span id="local-6989586621679488580"><span class="annot"><span class="annottext">p :: P a
</span><a href="#local-6989586621679488580"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Result"><span class="hs-identifier hs-type">Result</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">P a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span>     </span><span id="local-6989586621679488579"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679488579"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; ReadP ()
</span><a href="#local-6989586621679488578"><span class="hs-identifier hs-var">discard</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679488579"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP () -&gt; ReadP a -&gt; ReadP a
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
forall a. (forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-var">R</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">P a
</span><a href="#local-6989586621679488580"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">P a -&gt; (a -&gt; P b) -&gt; P b
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-238"></span><span>  </span><span class="annot"><a href="#local-6989586621679488589"><span class="hs-identifier hs-var">probe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-type">Final</span></a></span><span> </span><span id="local-6989586621679488576"><span class="annot"><span class="annottext">NonEmpty (a, String)
</span><a href="#local-6989586621679488576"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span>     </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
forall a. (forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-var">R</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NonEmpty (a, String) -&gt; P a
forall a. NonEmpty (a, String) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-var">Final</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (a, String)
</span><a href="#local-6989586621679488576"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">P a -&gt; (a -&gt; P b) -&gt; P b
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-239"></span><span>  </span><span class="annot"><a href="#local-6989586621679488589"><span class="hs-identifier hs-var">probe</span></a></span><span> </span><span class="annot"><span class="annottext">P a
</span><span class="hs-identifier">_</span></span><span>              </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span>     </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488591"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-240"></span><span>
</span><span id="line-241"></span><span>  </span><span id="local-6989586621679488578"><span class="annot"><span class="annottext">discard :: Int# -&gt; ReadP ()
</span><a href="#local-6989586621679488578"><span class="hs-identifier hs-var hs-var">discard</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; ReadP ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-242"></span><span>  </span><span class="annot"><a href="#local-6989586621679488578"><span class="hs-identifier hs-var">discard</span></a></span><span> </span><span id="local-6989586621679488572"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679488572"><span class="hs-identifier hs-var">n</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP Char
</span><a href="Text.ParserCombinators.ReadP.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP Char -&gt; ReadP () -&gt; ReadP ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; ReadP ()
</span><a href="#local-6989586621679488578"><span class="hs-identifier hs-var">discard</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679488572"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#-%23"><span class="hs-operator hs-var">-#</span></a></span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span class="hs-special">)</span><span>
</span><span id="line-243"></span><span>
</span><span id="line-244"></span><span id="local-6989586621679488956"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#gather"><span class="hs-identifier hs-type">gather</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488956"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679488956"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-245"></span><span class="hs-comment">-- ^ Transforms a parser into one that does the same, but</span><span>
</span><span id="line-246"></span><span class="hs-comment">--   in addition returns the exact characters read.</span><span>
</span><span id="line-247"></span><span class="hs-comment">--   IMPORTANT NOTE: 'gather' gives a runtime error if its first argument</span><span>
</span><span id="line-248"></span><span class="hs-comment">--   is built using any occurrences of readS_to_P.</span><span>
</span><span id="line-249"></span><span id="gather"><span class="annot"><span class="annottext">gather :: forall a. ReadP a -&gt; ReadP (String, a)
</span><a href="Text.ParserCombinators.ReadP.html#gather"><span class="hs-identifier hs-var hs-var">gather</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-type">R</span></a></span><span> </span><span id="local-6989586621679488571"><span class="annot"><span class="annottext">forall b. (a -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488571"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-250"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall b. ((String, a) -&gt; P b) -&gt; P b) -&gt; ReadP (String, a)
forall a. (forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-var">R</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488569"><span class="annot"><span class="annottext">(String, a) -&gt; P b
</span><a href="#local-6989586621679488569"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; P (String -&gt; P b) -&gt; P b
forall b. (String -&gt; String) -&gt; P (String -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488568"><span class="hs-identifier hs-var">gath</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
forall a. a -&gt; a
</span><a href="GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; P (String -&gt; P b)) -&gt; P (String -&gt; P b)
forall b. (a -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488571"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488566"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488566"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(String -&gt; P b) -&gt; P (String -&gt; P b)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488565"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488565"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(String, a) -&gt; P b
</span><a href="#local-6989586621679488569"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488565"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488566"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-251"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-252"></span><span>  </span><span id="local-6989586621679488953"><span class="annot"><a href="#local-6989586621679488568"><span class="hs-identifier hs-type">gath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488953"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#P"><span class="hs-identifier hs-type">P</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488953"><span class="hs-identifier hs-type">b</span></a></span></span><span>
</span><span id="line-253"></span><span>  </span><span id="local-6989586621679488568"><span class="annot"><span class="annottext">gath :: forall b. (String -&gt; String) -&gt; P (String -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488568"><span class="hs-identifier hs-var hs-var">gath</span></a></span></span><span> </span><span id="local-6989586621679488563"><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679488563"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span id="local-6989586621679488562"><span class="annot"><span class="annottext">Char -&gt; P (String -&gt; P b)
</span><a href="#local-6989586621679488562"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; P b) -&gt; P b
forall a. (Char -&gt; P a) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Get"><span class="hs-identifier hs-var">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488561"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488561"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; P (String -&gt; P b) -&gt; P b
forall b. (String -&gt; String) -&gt; P (String -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488568"><span class="hs-identifier hs-var">gath</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679488563"><span class="hs-identifier hs-var">l</span></a></span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; (String -&gt; String) -&gt; String -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488561"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; P (String -&gt; P b)
</span><a href="#local-6989586621679488562"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488561"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-254"></span><span>  </span><span class="annot"><a href="#local-6989586621679488568"><span class="hs-identifier hs-var">gath</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">P (String -&gt; P b)
</span><a href="Text.ParserCombinators.ReadP.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">P b
forall a. P a
</span><a href="Text.ParserCombinators.ReadP.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span>
</span><span id="line-255"></span><span>  </span><span class="annot"><a href="#local-6989586621679488568"><span class="hs-identifier hs-var">gath</span></a></span><span> </span><span id="local-6989586621679488560"><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679488560"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-type">Look</span></a></span><span> </span><span id="local-6989586621679488559"><span class="annot"><span class="annottext">String -&gt; P (String -&gt; P b)
</span><a href="#local-6989586621679488559"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; P b) -&gt; P b
forall a. (String -&gt; P a) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-var">Look</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488558"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488558"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; P (String -&gt; P b) -&gt; P b
forall b. (String -&gt; String) -&gt; P (String -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488568"><span class="hs-identifier hs-var">gath</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679488560"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; P (String -&gt; P b)
</span><a href="#local-6989586621679488559"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488558"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-256"></span><span>  </span><span class="annot"><a href="#local-6989586621679488568"><span class="hs-identifier hs-var">gath</span></a></span><span> </span><span id="local-6989586621679488557"><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679488557"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Result"><span class="hs-identifier hs-type">Result</span></a></span><span> </span><span id="local-6989586621679488556"><span class="annot"><span class="annottext">String -&gt; P b
</span><a href="#local-6989586621679488556"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679488555"><span class="annot"><span class="annottext">P (String -&gt; P b)
</span><a href="#local-6989586621679488555"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; P b
</span><a href="#local-6989586621679488556"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679488557"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">P b -&gt; P b -&gt; P b
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; P (String -&gt; P b) -&gt; P b
forall b. (String -&gt; String) -&gt; P (String -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488568"><span class="hs-identifier hs-var">gath</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679488557"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">P (String -&gt; P b)
</span><a href="#local-6989586621679488555"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-257"></span><span>  </span><span class="annot"><a href="#local-6989586621679488568"><span class="hs-identifier hs-var">gath</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#Final"><span class="hs-identifier hs-type">Final</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (String -&gt; P b, String)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; P b
forall a. String -&gt; a
</span><a href="GHC.Err.html#errorWithoutStackTrace"><span class="hs-identifier hs-var">errorWithoutStackTrace</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;do not use readS_to_P in gather!&quot;</span></span><span>
</span><span id="line-258"></span><span>
</span><span id="line-259"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-260"></span><span class="hs-comment">-- Derived operations</span><span>
</span><span id="line-261"></span><span>
</span><span id="line-262"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#satisfy"><span class="hs-identifier hs-type">satisfy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-263"></span><span class="hs-comment">-- ^ Consumes and returns the next character, if it satisfies the</span><span>
</span><span id="line-264"></span><span class="hs-comment">--   specified predicate.</span><span>
</span><span id="line-265"></span><span id="satisfy"><span class="annot"><span class="annottext">satisfy :: (Char -&gt; Bool) -&gt; ReadP Char
</span><a href="Text.ParserCombinators.ReadP.html#satisfy"><span class="hs-identifier hs-var hs-var">satisfy</span></a></span></span><span> </span><span id="local-6989586621679488553"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679488553"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679488552"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488552"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP Char
</span><a href="Text.ParserCombinators.ReadP.html#get"><span class="hs-identifier hs-var">get</span></a></span><span class="hs-special">;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679488553"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488552"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Char -&gt; ReadP Char
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488552"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">ReadP Char
forall a. ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#pfail"><span class="hs-identifier hs-var">pfail</span></a></span><span>
</span><span id="line-266"></span><span>
</span><span id="line-267"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#char"><span class="hs-identifier hs-type">char</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-268"></span><span class="hs-comment">-- ^ Parses and returns the specified character.</span><span>
</span><span id="line-269"></span><span id="char"><span class="annot"><span class="annottext">char :: Char -&gt; ReadP Char
</span><a href="Text.ParserCombinators.ReadP.html#char"><span class="hs-identifier hs-var hs-var">char</span></a></span></span><span> </span><span id="local-6989586621679488551"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488551"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; ReadP Char
</span><a href="Text.ParserCombinators.ReadP.html#satisfy"><span class="hs-identifier hs-var">satisfy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488551"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-270"></span><span>
</span><span id="line-271"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#eof"><span class="hs-identifier hs-type">eof</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-272"></span><span class="hs-comment">-- ^ Succeeds iff we are at the end of input</span><span>
</span><span id="line-273"></span><span id="eof"><span class="annot"><span class="annottext">eof :: ReadP ()
</span><a href="Text.ParserCombinators.ReadP.html#eof"><span class="hs-identifier hs-var hs-var">eof</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679488550"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488550"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP String
</span><a href="Text.ParserCombinators.ReadP.html#look"><span class="hs-identifier hs-var">look</span></a></span><span>
</span><span id="line-274"></span><span>         </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
forall a. [a] -&gt; Bool
</span><a href="GHC.List.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488550"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">() -&gt; ReadP ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-275"></span><span>                     </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">ReadP ()
forall a. ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#pfail"><span class="hs-identifier hs-var">pfail</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-276"></span><span>
</span><span id="line-277"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#string"><span class="hs-identifier hs-type">string</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-278"></span><span class="hs-comment">-- ^ Parses and returns the specified string.</span><span>
</span><span id="line-279"></span><span id="string"><span class="annot"><span class="annottext">string :: String -&gt; ReadP String
</span><a href="Text.ParserCombinators.ReadP.html#string"><span class="hs-identifier hs-var hs-var">string</span></a></span></span><span> </span><span id="local-6989586621679488549"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488549"><span class="hs-identifier hs-var">this</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679488548"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488548"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP String
</span><a href="Text.ParserCombinators.ReadP.html#look"><span class="hs-identifier hs-var">look</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; ReadP String
forall {a}. Eq a =&gt; [a] -&gt; [a] -&gt; ReadP String
</span><a href="#local-6989586621679488547"><span class="hs-identifier hs-var">scan</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488549"><span class="hs-identifier hs-var">this</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488548"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-280"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-281"></span><span>  </span><span id="local-6989586621679488547"><span class="annot"><span class="annottext">scan :: [a] -&gt; [a] -&gt; ReadP String
</span><a href="#local-6989586621679488547"><span class="hs-identifier hs-var hs-var">scan</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="annot"><span class="annottext">[a]
</span><span class="hs-identifier">_</span></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">String -&gt; ReadP String
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488549"><span class="hs-identifier hs-var">this</span></a></span><span>
</span><span id="line-282"></span><span>  </span><span class="annot"><a href="#local-6989586621679488547"><span class="hs-identifier hs-var">scan</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679488542"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488542"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679488541"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679488541"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679488540"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488540"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679488539"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679488539"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488542"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488540"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP Char
</span><a href="Text.ParserCombinators.ReadP.html#get"><span class="hs-identifier hs-var">get</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a] -&gt; ReadP String
</span><a href="#local-6989586621679488547"><span class="hs-identifier hs-var">scan</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679488541"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679488539"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-283"></span><span>  </span><span class="annot"><a href="#local-6989586621679488547"><span class="hs-identifier hs-var">scan</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><span class="hs-identifier">_</span></span><span>      </span><span class="annot"><span class="annottext">[a]
</span><span class="hs-identifier">_</span></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">ReadP String
forall a. ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#pfail"><span class="hs-identifier hs-var">pfail</span></a></span><span>
</span><span id="line-284"></span><span>
</span><span id="line-285"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#munch"><span class="hs-identifier hs-type">munch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-286"></span><span class="hs-comment">-- ^ Parses the first zero or more characters satisfying the predicate.</span><span>
</span><span id="line-287"></span><span class="hs-comment">--   Always succeeds, exactly once having consumed all the characters</span><span>
</span><span id="line-288"></span><span class="hs-comment">--   Hence NOT the same as (many (satisfy p))</span><span>
</span><span id="line-289"></span><span id="munch"><span class="annot"><span class="annottext">munch :: (Char -&gt; Bool) -&gt; ReadP String
</span><a href="Text.ParserCombinators.ReadP.html#munch"><span class="hs-identifier hs-var hs-var">munch</span></a></span></span><span> </span><span id="local-6989586621679488538"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679488538"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-290"></span><span>  </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679488537"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488537"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP String
</span><a href="Text.ParserCombinators.ReadP.html#look"><span class="hs-identifier hs-var">look</span></a></span><span>
</span><span id="line-291"></span><span>     </span><span class="annot"><span class="annottext">String -&gt; ReadP String
</span><a href="#local-6989586621679488536"><span class="hs-identifier hs-var">scan</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488537"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-292"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-293"></span><span>  </span><span id="local-6989586621679488536"><span class="annot"><span class="annottext">scan :: String -&gt; ReadP String
</span><a href="#local-6989586621679488536"><span class="hs-identifier hs-var hs-var">scan</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679488531"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488531"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679488530"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488530"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679488538"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488531"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP Char
</span><a href="Text.ParserCombinators.ReadP.html#get"><span class="hs-identifier hs-var">get</span></a></span><span class="hs-special">;</span><span> </span><span id="local-6989586621679488529"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488529"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; ReadP String
</span><a href="#local-6989586621679488536"><span class="hs-identifier hs-var">scan</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488530"><span class="hs-identifier hs-var">cs</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; ReadP String
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488531"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488529"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-294"></span><span>  </span><span class="annot"><a href="#local-6989586621679488536"><span class="hs-identifier hs-var">scan</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">String -&gt; ReadP String
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-295"></span><span>
</span><span id="line-296"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#munch1"><span class="hs-identifier hs-type">munch1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-297"></span><span class="hs-comment">-- ^ Parses the first one or more characters satisfying the predicate.</span><span>
</span><span id="line-298"></span><span class="hs-comment">--   Fails if none, else succeeds exactly once having consumed all the characters</span><span>
</span><span id="line-299"></span><span class="hs-comment">--   Hence NOT the same as (many1 (satisfy p))</span><span>
</span><span id="line-300"></span><span id="munch1"><span class="annot"><span class="annottext">munch1 :: (Char -&gt; Bool) -&gt; ReadP String
</span><a href="Text.ParserCombinators.ReadP.html#munch1"><span class="hs-identifier hs-var hs-var">munch1</span></a></span></span><span> </span><span id="local-6989586621679488528"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679488528"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-301"></span><span>  </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679488527"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488527"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP Char
</span><a href="Text.ParserCombinators.ReadP.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-302"></span><span>     </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679488528"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488527"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679488526"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488526"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; ReadP String
</span><a href="Text.ParserCombinators.ReadP.html#munch"><span class="hs-identifier hs-var">munch</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679488528"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; ReadP String
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488527"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488526"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-303"></span><span>            </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">ReadP String
forall a. ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#pfail"><span class="hs-identifier hs-var">pfail</span></a></span><span>
</span><span id="line-304"></span><span>
</span><span id="line-305"></span><span id="local-6989586621679488945"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#choice"><span class="hs-identifier hs-type">choice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488945"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488945"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-306"></span><span class="hs-comment">-- ^ Combines all parsers in the specified list.</span><span>
</span><span id="line-307"></span><span id="choice"><span class="annot"><span class="annottext">choice :: forall a. [ReadP a] -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#choice"><span class="hs-identifier hs-var hs-var">choice</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a
forall a. ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#pfail"><span class="hs-identifier hs-var">pfail</span></a></span><span>
</span><span id="line-308"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#choice"><span class="hs-identifier hs-var">choice</span></a></span><span> </span><span class="hs-special">[</span><span id="local-6989586621679488525"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488525"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">]</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488525"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-309"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#choice"><span class="hs-identifier hs-var">choice</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679488524"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488524"><span class="hs-identifier hs-var">p</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679488523"><span class="annot"><span class="annottext">[ReadP a]
</span><a href="#local-6989586621679488523"><span class="hs-identifier hs-var">ps</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488524"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP a -&gt; ReadP a
forall a. ReadP a -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#%2B%2B%2B"><span class="hs-operator hs-var">+++</span></a></span><span> </span><span class="annot"><span class="annottext">[ReadP a] -&gt; ReadP a
forall a. [ReadP a] -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#choice"><span class="hs-identifier hs-var">choice</span></a></span><span> </span><span class="annot"><span class="annottext">[ReadP a]
</span><a href="#local-6989586621679488523"><span class="hs-identifier hs-var">ps</span></a></span><span>
</span><span id="line-310"></span><span>
</span><span id="line-311"></span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#skipSpaces"><span class="hs-identifier hs-type">skipSpaces</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-312"></span><span class="hs-comment">-- ^ Skips all whitespace.</span><span>
</span><span id="line-313"></span><span id="skipSpaces"><span class="annot"><span class="annottext">skipSpaces :: ReadP ()
</span><a href="Text.ParserCombinators.ReadP.html#skipSpaces"><span class="hs-identifier hs-var hs-var">skipSpaces</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-314"></span><span>  </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679488522"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488522"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP String
</span><a href="Text.ParserCombinators.ReadP.html#look"><span class="hs-identifier hs-var">look</span></a></span><span>
</span><span id="line-315"></span><span>     </span><span class="annot"><span class="annottext">String -&gt; ReadP ()
</span><a href="#local-6989586621679488521"><span class="hs-identifier hs-var">skip</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488522"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-316"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-317"></span><span>  </span><span id="local-6989586621679488521"><span class="annot"><span class="annottext">skip :: String -&gt; ReadP ()
</span><a href="#local-6989586621679488521"><span class="hs-identifier hs-var hs-var">skip</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679488518"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488518"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679488517"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488517"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="GHC.Unicode.html#isSpace"><span class="hs-identifier hs-var">isSpace</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679488518"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP Char
</span><a href="Text.ParserCombinators.ReadP.html#get"><span class="hs-identifier hs-var">get</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; ReadP ()
</span><a href="#local-6989586621679488521"><span class="hs-identifier hs-var">skip</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488517"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-318"></span><span>  </span><span class="annot"><a href="#local-6989586621679488521"><span class="hs-identifier hs-var">skip</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">() -&gt; ReadP ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-319"></span><span>
</span><span id="line-320"></span><span id="local-6989586621679488943"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#count"><span class="hs-identifier hs-type">count</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488943"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679488943"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-321"></span><span class="hs-comment">-- ^ @count n p@ parses @n@ occurrences of @p@ in sequence. A list of</span><span>
</span><span id="line-322"></span><span class="hs-comment">--   results is returned.</span><span>
</span><span id="line-323"></span><span id="count"><span class="annot"><span class="annottext">count :: forall a. Int -&gt; ReadP a -&gt; ReadP [a]
</span><a href="Text.ParserCombinators.ReadP.html#count"><span class="hs-identifier hs-var hs-var">count</span></a></span></span><span> </span><span id="local-6989586621679488515"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679488515"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679488514"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488514"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ReadP a] -&gt; ReadP [a]
forall (m :: * -&gt; *) a. Monad m =&gt; [m a] -&gt; m [a]
</span><a href="GHC.Base.html#sequence"><span class="hs-identifier hs-var">sequence</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ReadP a -&gt; [ReadP a]
forall a. Int -&gt; a -&gt; [a]
</span><a href="GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679488515"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488514"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-324"></span><span>
</span><span id="line-325"></span><span id="local-6989586621679488936"><span id="local-6989586621679488937"><span id="local-6989586621679488938"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#between"><span class="hs-identifier hs-type">between</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488938"><span class="hs-identifier hs-type">open</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488937"><span class="hs-identifier hs-type">close</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488936"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488936"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-326"></span><span class="hs-comment">-- ^ @between open close p@ parses @open@, followed by @p@ and finally</span><span>
</span><span id="line-327"></span><span class="hs-comment">--   @close@. Only the value of @p@ is returned.</span><span>
</span><span id="line-328"></span><span id="between"><span class="annot"><span class="annottext">between :: forall open close a.
ReadP open -&gt; ReadP close -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#between"><span class="hs-identifier hs-var hs-var">between</span></a></span></span><span> </span><span id="local-6989586621679488508"><span class="annot"><span class="annottext">ReadP open
</span><a href="#local-6989586621679488508"><span class="hs-identifier hs-var">open</span></a></span></span><span> </span><span id="local-6989586621679488507"><span class="annot"><span class="annottext">ReadP close
</span><a href="#local-6989586621679488507"><span class="hs-identifier hs-var">close</span></a></span></span><span> </span><span id="local-6989586621679488506"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488506"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">open
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP open
</span><a href="#local-6989586621679488508"><span class="hs-identifier hs-var">open</span></a></span><span>
</span><span id="line-329"></span><span>                          </span><span id="local-6989586621679488505"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488505"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488506"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-330"></span><span>                          </span><span class="annot"><span class="annottext">close
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP close
</span><a href="#local-6989586621679488507"><span class="hs-identifier hs-var">close</span></a></span><span>
</span><span id="line-331"></span><span>                          </span><span class="annot"><span class="annottext">a -&gt; ReadP a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488505"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-332"></span><span>
</span><span id="line-333"></span><span id="local-6989586621679488932"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#option"><span class="hs-identifier hs-type">option</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679488932"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488932"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488932"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-334"></span><span class="hs-comment">-- ^ @option x p@ will either parse @p@ or return @x@ without consuming</span><span>
</span><span id="line-335"></span><span class="hs-comment">--   any input.</span><span>
</span><span id="line-336"></span><span id="option"><span class="annot"><span class="annottext">option :: forall a. a -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#option"><span class="hs-identifier hs-var hs-var">option</span></a></span></span><span> </span><span id="local-6989586621679488503"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488503"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679488502"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488502"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488502"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP a -&gt; ReadP a
forall a. ReadP a -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#%2B%2B%2B"><span class="hs-operator hs-var">+++</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; ReadP a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488503"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-337"></span><span>
</span><span id="line-338"></span><span id="local-6989586621679488930"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#optional"><span class="hs-identifier hs-type">optional</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488930"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-339"></span><span class="hs-comment">-- ^ @optional p@ optionally parses @p@ and always returns @()@.</span><span>
</span><span id="line-340"></span><span id="optional"><span class="annot"><span class="annottext">optional :: forall a. ReadP a -&gt; ReadP ()
</span><a href="Text.ParserCombinators.ReadP.html#optional"><span class="hs-identifier hs-var hs-var">optional</span></a></span></span><span> </span><span id="local-6989586621679488498"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488498"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488498"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP () -&gt; ReadP ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; ReadP ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ReadP () -&gt; ReadP () -&gt; ReadP ()
forall a. ReadP a -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#%2B%2B%2B"><span class="hs-operator hs-var">+++</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; ReadP ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-341"></span><span>
</span><span id="line-342"></span><span id="local-6989586621679488497"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#many"><span class="hs-identifier hs-type">many</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488497"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679488497"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-343"></span><span class="hs-comment">-- ^ Parses zero or more occurrences of the given parser.</span><span>
</span><span id="line-344"></span><span id="many"><span class="annot"><span class="annottext">many :: forall a. ReadP a -&gt; ReadP [a]
</span><a href="Text.ParserCombinators.ReadP.html#many"><span class="hs-identifier hs-var hs-var">many</span></a></span></span><span> </span><span id="local-6989586621679488495"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488495"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; ReadP [a]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ReadP [a] -&gt; ReadP [a] -&gt; ReadP [a]
forall a. ReadP a -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#%2B%2B%2B"><span class="hs-operator hs-var">+++</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP [a]
forall a. ReadP a -&gt; ReadP [a]
</span><a href="Text.ParserCombinators.ReadP.html#many1"><span class="hs-identifier hs-var">many1</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488495"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-345"></span><span>
</span><span id="line-346"></span><span id="local-6989586621679488494"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#many1"><span class="hs-identifier hs-type">many1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488494"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679488494"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-347"></span><span class="hs-comment">-- ^ Parses one or more occurrences of the given parser.</span><span>
</span><span id="line-348"></span><span id="many1"><span class="annot"><span class="annottext">many1 :: forall a. ReadP a -&gt; ReadP [a]
</span><a href="Text.ParserCombinators.ReadP.html#many1"><span class="hs-identifier hs-var hs-var">many1</span></a></span></span><span> </span><span id="local-6989586621679488492"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488492"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; [a] -&gt; [a]) -&gt; ReadP a -&gt; ReadP [a] -&gt; ReadP [a]
forall (m :: * -&gt; *) a1 a2 r.
Monad m =&gt;
(a1 -&gt; a2 -&gt; r) -&gt; m a1 -&gt; m a2 -&gt; m r
</span><a href="GHC.Base.html#liftM2"><span class="hs-identifier hs-var">liftM2</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488492"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP [a]
forall a. ReadP a -&gt; ReadP [a]
</span><a href="Text.ParserCombinators.ReadP.html#many"><span class="hs-identifier hs-var">many</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488492"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-349"></span><span>
</span><span id="line-350"></span><span id="local-6989586621679488490"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#skipMany"><span class="hs-identifier hs-type">skipMany</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488490"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-351"></span><span class="hs-comment">-- ^ Like 'many', but discards the result.</span><span>
</span><span id="line-352"></span><span id="skipMany"><span class="annot"><span class="annottext">skipMany :: forall a. ReadP a -&gt; ReadP ()
</span><a href="Text.ParserCombinators.ReadP.html#skipMany"><span class="hs-identifier hs-var hs-var">skipMany</span></a></span></span><span> </span><span id="local-6989586621679488487"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488487"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP [a]
forall a. ReadP a -&gt; ReadP [a]
</span><a href="Text.ParserCombinators.ReadP.html#many"><span class="hs-identifier hs-var">many</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488487"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP [a] -&gt; ReadP () -&gt; ReadP ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; ReadP ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-353"></span><span>
</span><span id="line-354"></span><span id="local-6989586621679488486"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#skipMany1"><span class="hs-identifier hs-type">skipMany1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488486"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-355"></span><span class="hs-comment">-- ^ Like 'many1', but discards the result.</span><span>
</span><span id="line-356"></span><span id="skipMany1"><span class="annot"><span class="annottext">skipMany1 :: forall a. ReadP a -&gt; ReadP ()
</span><a href="Text.ParserCombinators.ReadP.html#skipMany1"><span class="hs-identifier hs-var hs-var">skipMany1</span></a></span></span><span> </span><span id="local-6989586621679488484"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488484"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488484"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP () -&gt; ReadP ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP ()
forall a. ReadP a -&gt; ReadP ()
</span><a href="Text.ParserCombinators.ReadP.html#skipMany"><span class="hs-identifier hs-var">skipMany</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488484"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-357"></span><span>
</span><span id="line-358"></span><span id="local-6989586621679488919"><span id="local-6989586621679488920"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#sepBy"><span class="hs-identifier hs-type">sepBy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488920"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488919"><span class="hs-identifier hs-type">sep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679488920"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-359"></span><span class="hs-comment">-- ^ @sepBy p sep@ parses zero or more occurrences of @p@, separated by @sep@.</span><span>
</span><span id="line-360"></span><span class="hs-comment">--   Returns a list of values returned by @p@.</span><span>
</span><span id="line-361"></span><span id="sepBy"><span class="annot"><span class="annottext">sepBy :: forall a sep. ReadP a -&gt; ReadP sep -&gt; ReadP [a]
</span><a href="Text.ParserCombinators.ReadP.html#sepBy"><span class="hs-identifier hs-var hs-var">sepBy</span></a></span></span><span> </span><span id="local-6989586621679488482"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488482"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679488481"><span class="annot"><span class="annottext">ReadP sep
</span><a href="#local-6989586621679488481"><span class="hs-identifier hs-var">sep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP sep -&gt; ReadP [a]
forall a sep. ReadP a -&gt; ReadP sep -&gt; ReadP [a]
</span><a href="Text.ParserCombinators.ReadP.html#sepBy1"><span class="hs-identifier hs-var">sepBy1</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488482"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP sep
</span><a href="#local-6989586621679488481"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP [a] -&gt; ReadP [a] -&gt; ReadP [a]
forall a. ReadP a -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#%2B%2B%2B"><span class="hs-operator hs-var">+++</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; ReadP [a]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-362"></span><span>
</span><span id="line-363"></span><span id="local-6989586621679488479"><span id="local-6989586621679488480"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#sepBy1"><span class="hs-identifier hs-type">sepBy1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488480"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488479"><span class="hs-identifier hs-type">sep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679488480"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-364"></span><span class="hs-comment">-- ^ @sepBy1 p sep@ parses one or more occurrences of @p@, separated by @sep@.</span><span>
</span><span id="line-365"></span><span class="hs-comment">--   Returns a list of values returned by @p@.</span><span>
</span><span id="line-366"></span><span id="sepBy1"><span class="annot"><span class="annottext">sepBy1 :: forall a sep. ReadP a -&gt; ReadP sep -&gt; ReadP [a]
</span><a href="Text.ParserCombinators.ReadP.html#sepBy1"><span class="hs-identifier hs-var hs-var">sepBy1</span></a></span></span><span> </span><span id="local-6989586621679488476"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488476"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679488475"><span class="annot"><span class="annottext">ReadP sep
</span><a href="#local-6989586621679488475"><span class="hs-identifier hs-var">sep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; [a] -&gt; [a]) -&gt; ReadP a -&gt; ReadP [a] -&gt; ReadP [a]
forall (m :: * -&gt; *) a1 a2 r.
Monad m =&gt;
(a1 -&gt; a2 -&gt; r) -&gt; m a1 -&gt; m a2 -&gt; m r
</span><a href="GHC.Base.html#liftM2"><span class="hs-identifier hs-var">liftM2</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488476"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP [a]
forall a. ReadP a -&gt; ReadP [a]
</span><a href="Text.ParserCombinators.ReadP.html#many"><span class="hs-identifier hs-var">many</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ReadP sep
</span><a href="#local-6989586621679488475"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP sep -&gt; ReadP a -&gt; ReadP a
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488476"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-367"></span><span>
</span><span id="line-368"></span><span id="local-6989586621679488473"><span id="local-6989586621679488474"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#endBy"><span class="hs-identifier hs-type">endBy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488474"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488473"><span class="hs-identifier hs-type">sep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679488474"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-369"></span><span class="hs-comment">-- ^ @endBy p sep@ parses zero or more occurrences of @p@, separated and ended</span><span>
</span><span id="line-370"></span><span class="hs-comment">--   by @sep@.</span><span>
</span><span id="line-371"></span><span id="endBy"><span class="annot"><span class="annottext">endBy :: forall a sep. ReadP a -&gt; ReadP sep -&gt; ReadP [a]
</span><a href="Text.ParserCombinators.ReadP.html#endBy"><span class="hs-identifier hs-var hs-var">endBy</span></a></span></span><span> </span><span id="local-6989586621679488469"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488469"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679488468"><span class="annot"><span class="annottext">ReadP sep
</span><a href="#local-6989586621679488468"><span class="hs-identifier hs-var">sep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP [a]
forall a. ReadP a -&gt; ReadP [a]
</span><a href="Text.ParserCombinators.ReadP.html#many"><span class="hs-identifier hs-var">many</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679488467"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488467"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488469"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">sep
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP sep
</span><a href="#local-6989586621679488468"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">a -&gt; ReadP a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488467"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-372"></span><span>
</span><span id="line-373"></span><span id="local-6989586621679488465"><span id="local-6989586621679488466"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#endBy1"><span class="hs-identifier hs-type">endBy1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488466"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488465"><span class="hs-identifier hs-type">sep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679488466"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-374"></span><span class="hs-comment">-- ^ @endBy p sep@ parses one or more occurrences of @p@, separated and ended</span><span>
</span><span id="line-375"></span><span class="hs-comment">--   by @sep@.</span><span>
</span><span id="line-376"></span><span id="endBy1"><span class="annot"><span class="annottext">endBy1 :: forall a sep. ReadP a -&gt; ReadP sep -&gt; ReadP [a]
</span><a href="Text.ParserCombinators.ReadP.html#endBy1"><span class="hs-identifier hs-var hs-var">endBy1</span></a></span></span><span> </span><span id="local-6989586621679488461"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488461"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679488460"><span class="annot"><span class="annottext">ReadP sep
</span><a href="#local-6989586621679488460"><span class="hs-identifier hs-var">sep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP [a]
forall a. ReadP a -&gt; ReadP [a]
</span><a href="Text.ParserCombinators.ReadP.html#many1"><span class="hs-identifier hs-var">many1</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679488459"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488459"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488461"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">sep
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP sep
</span><a href="#local-6989586621679488460"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">a -&gt; ReadP a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488459"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-377"></span><span>
</span><span id="line-378"></span><span id="local-6989586621679488910"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#chainr"><span class="hs-identifier hs-type">chainr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488910"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679488910"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679488910"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679488910"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679488910"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488910"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-379"></span><span class="hs-comment">-- ^ @chainr p op x@ parses zero or more occurrences of @p@, separated by @op@.</span><span>
</span><span id="line-380"></span><span class="hs-comment">--   Returns a value produced by a /right/ associative application of all</span><span>
</span><span id="line-381"></span><span class="hs-comment">--   functions returned by @op@. If there are no occurrences of @p@, @x@ is</span><span>
</span><span id="line-382"></span><span class="hs-comment">--   returned.</span><span>
</span><span id="line-383"></span><span id="chainr"><span class="annot"><span class="annottext">chainr :: forall a. ReadP a -&gt; ReadP (a -&gt; a -&gt; a) -&gt; a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#chainr"><span class="hs-identifier hs-var hs-var">chainr</span></a></span></span><span> </span><span id="local-6989586621679488457"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488457"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679488456"><span class="annot"><span class="annottext">ReadP (a -&gt; a -&gt; a)
</span><a href="#local-6989586621679488456"><span class="hs-identifier hs-var">op</span></a></span></span><span> </span><span id="local-6989586621679488455"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488455"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP (a -&gt; a -&gt; a) -&gt; ReadP a
forall a. ReadP a -&gt; ReadP (a -&gt; a -&gt; a) -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#chainr1"><span class="hs-identifier hs-var">chainr1</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488457"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP (a -&gt; a -&gt; a)
</span><a href="#local-6989586621679488456"><span class="hs-identifier hs-var">op</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP a -&gt; ReadP a
forall a. ReadP a -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#%2B%2B%2B"><span class="hs-operator hs-var">+++</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; ReadP a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488455"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-384"></span><span>
</span><span id="line-385"></span><span id="local-6989586621679488454"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#chainl"><span class="hs-identifier hs-type">chainl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488454"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679488454"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679488454"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679488454"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679488454"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488454"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-386"></span><span class="hs-comment">-- ^ @chainl p op x@ parses zero or more occurrences of @p@, separated by @op@.</span><span>
</span><span id="line-387"></span><span class="hs-comment">--   Returns a value produced by a /left/ associative application of all</span><span>
</span><span id="line-388"></span><span class="hs-comment">--   functions returned by @op@. If there are no occurrences of @p@, @x@ is</span><span>
</span><span id="line-389"></span><span class="hs-comment">--   returned.</span><span>
</span><span id="line-390"></span><span id="chainl"><span class="annot"><span class="annottext">chainl :: forall a. ReadP a -&gt; ReadP (a -&gt; a -&gt; a) -&gt; a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#chainl"><span class="hs-identifier hs-var hs-var">chainl</span></a></span></span><span> </span><span id="local-6989586621679488452"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488452"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679488451"><span class="annot"><span class="annottext">ReadP (a -&gt; a -&gt; a)
</span><a href="#local-6989586621679488451"><span class="hs-identifier hs-var">op</span></a></span></span><span> </span><span id="local-6989586621679488450"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488450"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP (a -&gt; a -&gt; a) -&gt; ReadP a
forall a. ReadP a -&gt; ReadP (a -&gt; a -&gt; a) -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#chainl1"><span class="hs-identifier hs-var">chainl1</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488452"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP (a -&gt; a -&gt; a)
</span><a href="#local-6989586621679488451"><span class="hs-identifier hs-var">op</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP a -&gt; ReadP a
forall a. ReadP a -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#%2B%2B%2B"><span class="hs-operator hs-var">+++</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; ReadP a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488450"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-391"></span><span>
</span><span id="line-392"></span><span id="local-6989586621679488908"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#chainr1"><span class="hs-identifier hs-type">chainr1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488908"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679488908"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679488908"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679488908"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488908"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-393"></span><span class="hs-comment">-- ^ Like 'chainr', but parses one or more occurrences of @p@.</span><span>
</span><span id="line-394"></span><span id="chainr1"><span class="annot"><span class="annottext">chainr1 :: forall a. ReadP a -&gt; ReadP (a -&gt; a -&gt; a) -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#chainr1"><span class="hs-identifier hs-var hs-var">chainr1</span></a></span></span><span> </span><span id="local-6989586621679488449"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488449"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679488448"><span class="annot"><span class="annottext">ReadP (a -&gt; a -&gt; a)
</span><a href="#local-6989586621679488448"><span class="hs-identifier hs-var">op</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488447"><span class="hs-identifier hs-var">scan</span></a></span><span>
</span><span id="line-395"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679488447"><span class="annot"><span class="annottext">scan :: ReadP a
</span><a href="#local-6989586621679488447"><span class="hs-identifier hs-var hs-var">scan</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488449"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; (a -&gt; ReadP a) -&gt; ReadP a
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; ReadP a
</span><a href="#local-6989586621679488441"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-396"></span><span>        </span><span id="local-6989586621679488441"><span class="annot"><span class="annottext">rest :: a -&gt; ReadP a
</span><a href="#local-6989586621679488441"><span class="hs-identifier hs-var hs-var">rest</span></a></span></span><span> </span><span id="local-6989586621679488440"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488440"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679488439"><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621679488439"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP (a -&gt; a -&gt; a)
</span><a href="#local-6989586621679488448"><span class="hs-identifier hs-var">op</span></a></span><span>
</span><span id="line-397"></span><span>                    </span><span id="local-6989586621679488438"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488438"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488447"><span class="hs-identifier hs-var">scan</span></a></span><span>
</span><span id="line-398"></span><span>                    </span><span class="annot"><span class="annottext">a -&gt; ReadP a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621679488439"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488440"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488438"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-399"></span><span>                 </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP a -&gt; ReadP a
forall a. ReadP a -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#%2B%2B%2B"><span class="hs-operator hs-var">+++</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; ReadP a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488440"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-400"></span><span>
</span><span id="line-401"></span><span id="local-6989586621679488437"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#chainl1"><span class="hs-identifier hs-type">chainl1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488437"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679488437"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679488437"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679488437"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488437"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-402"></span><span class="hs-comment">-- ^ Like 'chainl', but parses one or more occurrences of @p@.</span><span>
</span><span id="line-403"></span><span id="chainl1"><span class="annot"><span class="annottext">chainl1 :: forall a. ReadP a -&gt; ReadP (a -&gt; a -&gt; a) -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#chainl1"><span class="hs-identifier hs-var hs-var">chainl1</span></a></span></span><span> </span><span id="local-6989586621679488435"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488435"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679488434"><span class="annot"><span class="annottext">ReadP (a -&gt; a -&gt; a)
</span><a href="#local-6989586621679488434"><span class="hs-identifier hs-var">op</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488435"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP a -&gt; (a -&gt; ReadP a) -&gt; ReadP a
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; ReadP a
</span><a href="#local-6989586621679488433"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-404"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679488433"><span class="annot"><span class="annottext">rest :: a -&gt; ReadP a
</span><a href="#local-6989586621679488433"><span class="hs-identifier hs-var hs-var">rest</span></a></span></span><span> </span><span id="local-6989586621679488429"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488429"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679488428"><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621679488428"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP (a -&gt; a -&gt; a)
</span><a href="#local-6989586621679488434"><span class="hs-identifier hs-var">op</span></a></span><span>
</span><span id="line-405"></span><span>                    </span><span id="local-6989586621679488427"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488427"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488435"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-406"></span><span>                    </span><span class="annot"><span class="annottext">a -&gt; ReadP a
</span><a href="#local-6989586621679488433"><span class="hs-identifier hs-var">rest</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621679488428"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488429"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488427"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-407"></span><span>                 </span><span class="annot"><span class="annottext">ReadP a -&gt; ReadP a -&gt; ReadP a
forall a. ReadP a -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#%2B%2B%2B"><span class="hs-operator hs-var">+++</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; ReadP a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488429"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-408"></span><span>
</span><span id="line-409"></span><span id="local-6989586621679488425"><span id="local-6989586621679488426"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#manyTill"><span class="hs-identifier hs-type">manyTill</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488426"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488425"><span class="hs-identifier hs-type">end</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679488426"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-410"></span><span class="hs-comment">-- ^ @manyTill p end@ parses zero or more occurrences of @p@, until @end@</span><span>
</span><span id="line-411"></span><span class="hs-comment">--   succeeds. Returns a list of values returned by @p@.</span><span>
</span><span id="line-412"></span><span id="manyTill"><span class="annot"><span class="annottext">manyTill :: forall a sep. ReadP a -&gt; ReadP sep -&gt; ReadP [a]
</span><a href="Text.ParserCombinators.ReadP.html#manyTill"><span class="hs-identifier hs-var hs-var">manyTill</span></a></span></span><span> </span><span id="local-6989586621679488424"><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488424"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679488423"><span class="annot"><span class="annottext">ReadP end
</span><a href="#local-6989586621679488423"><span class="hs-identifier hs-var">end</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadP [a]
</span><a href="#local-6989586621679488422"><span class="hs-identifier hs-var">scan</span></a></span><span>
</span><span id="line-413"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679488422"><span class="annot"><span class="annottext">scan :: ReadP [a]
</span><a href="#local-6989586621679488422"><span class="hs-identifier hs-var hs-var">scan</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ReadP end
</span><a href="#local-6989586621679488423"><span class="hs-identifier hs-var">end</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP end -&gt; ReadP [a] -&gt; ReadP [a]
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; ReadP [a]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ReadP [a] -&gt; ReadP [a] -&gt; ReadP [a]
forall a. ReadP a -&gt; ReadP a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#%3C%2B%2B"><span class="hs-operator hs-var">&lt;++</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; [a] -&gt; [a]) -&gt; ReadP a -&gt; ReadP [a] -&gt; ReadP [a]
forall (m :: * -&gt; *) a1 a2 r.
Monad m =&gt;
(a1 -&gt; a2 -&gt; r) -&gt; m a1 -&gt; m a2 -&gt; m r
</span><a href="GHC.Base.html#liftM2"><span class="hs-identifier hs-var">liftM2</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ReadP a
</span><a href="#local-6989586621679488424"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">ReadP [a]
</span><a href="#local-6989586621679488422"><span class="hs-identifier hs-var">scan</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-414"></span><span>
</span><span id="line-415"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-416"></span><span class="hs-comment">-- Converting between ReadP and Read</span><span>
</span><span id="line-417"></span><span>
</span><span id="line-418"></span><span id="local-6989586621679488902"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#readP_to_S"><span class="hs-identifier hs-type">readP_to_S</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488902"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadS"><span class="hs-identifier hs-type">ReadS</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488902"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-419"></span><span class="hs-comment">-- ^ Converts a parser into a Haskell ReadS-style function.</span><span>
</span><span id="line-420"></span><span class="hs-comment">--   This is the main way in which you can \&quot;run\&quot; a 'ReadP' parser:</span><span>
</span><span id="line-421"></span><span class="hs-comment">--   the expanded type is</span><span>
</span><span id="line-422"></span><span class="hs-comment">-- @ readP_to_S :: ReadP a -&gt; String -&gt; [(a,String)] @</span><span>
</span><span id="line-423"></span><span id="readP_to_S"><span class="annot"><span class="annottext">readP_to_S :: forall a. ReadP a -&gt; ReadS a
</span><a href="Text.ParserCombinators.ReadP.html#readP_to_S"><span class="hs-identifier hs-var hs-var">readP_to_S</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-type">R</span></a></span><span> </span><span id="local-6989586621679488417"><span class="annot"><span class="annottext">forall b. (a -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488417"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">P a -&gt; ReadS a
forall a. P a -&gt; ReadS a
</span><a href="Text.ParserCombinators.ReadP.html#run"><span class="hs-identifier hs-var">run</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; P a) -&gt; P a
forall b. (a -&gt; P b) -&gt; P b
</span><a href="#local-6989586621679488417"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; P a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-424"></span><span>
</span><span id="line-425"></span><span id="local-6989586621679488900"><span class="annot"><a href="Text.ParserCombinators.ReadP.html#readS_to_P"><span class="hs-identifier hs-type">readS_to_P</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadS"><span class="hs-identifier hs-type">ReadS</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488900"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadP.html#ReadP"><span class="hs-identifier hs-type">ReadP</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679488900"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-426"></span><span class="hs-comment">-- ^ Converts a Haskell ReadS-style function into a parser.</span><span>
</span><span id="line-427"></span><span class="hs-comment">--   Warning: This introduces local backtracking in the resulting</span><span>
</span><span id="line-428"></span><span class="hs-comment">--   parser, and therefore a possible inefficiency.</span><span>
</span><span id="line-429"></span><span id="readS_to_P"><span class="annot"><span class="annottext">readS_to_P :: forall a. ReadS a -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#readS_to_P"><span class="hs-identifier hs-var hs-var">readS_to_P</span></a></span></span><span> </span><span id="local-6989586621679488416"><span class="annot"><span class="annottext">ReadS a
</span><a href="#local-6989586621679488416"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-430"></span><span>  </span><span class="annot"><span class="annottext">(forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
forall a. (forall b. (a -&gt; P b) -&gt; P b) -&gt; ReadP a
</span><a href="Text.ParserCombinators.ReadP.html#R"><span class="hs-identifier hs-var">R</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488415"><span class="annot"><span class="annottext">a -&gt; P b
</span><a href="#local-6989586621679488415"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(String -&gt; P b) -&gt; P b
forall a. (String -&gt; P a) -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#Look"><span class="hs-identifier hs-var">Look</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679488414"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488414"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[(b, String)] -&gt; P b
forall a. [(a, String)] -&gt; P a
</span><a href="Text.ParserCombinators.ReadP.html#final"><span class="hs-identifier hs-var">final</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">(b, String)
</span><a href="#local-6989586621679488413"><span class="hs-identifier hs-var">bs''</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679488412"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488412"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679488411"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488411"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadS a
</span><a href="#local-6989586621679488416"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488414"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679488413"><span class="annot"><span class="annottext">(b, String)
</span><a href="#local-6989586621679488413"><span class="hs-identifier hs-var">bs''</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">P b -&gt; ReadS b
forall a. P a -&gt; ReadS a
</span><a href="Text.ParserCombinators.ReadP.html#run"><span class="hs-identifier hs-var">run</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; P b
</span><a href="#local-6989586621679488415"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679488412"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679488411"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-431"></span><span>
</span><span id="line-432"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-433"></span><span class="hs-comment">-- QuickCheck properties that hold for the combinators</span><span>
</span><span id="line-434"></span><span>
</span><span id="line-435"></span><span class="hs-comment">{- $properties
The following are QuickCheck specifications of what the combinators do.
These can be seen as formal specifications of the behavior of the
combinators.

For some values, we only care about the lists contents, not their order,

&gt; (=~) :: Ord a =&gt; [a] -&gt; [a] -&gt; Bool
&gt; xs =~ ys = sort xs == sort ys

Here follow the properties:

&gt;&gt;&gt; readP_to_S get []
[]

prop&gt; \c str -&gt; readP_to_S get (c:str) == [(c, str)]

prop&gt; \str -&gt; readP_to_S look str == [(str, str)]

prop&gt; \str -&gt; readP_to_S pfail str == []

prop&gt; \x str -&gt; readP_to_S (return x) s == [(x,s)]

&gt; prop_Bind p k s =
&gt;    readP_to_S (p &gt;&gt;= k) s =~
&gt;      [ ys''
&gt;      | (x,s') &lt;- readP_to_S p s
&gt;      , ys''   &lt;- readP_to_S (k (x::Int)) s'
&gt;      ]

&gt; prop_Plus p q s =
&gt;   readP_to_S (p +++ q) s =~
&gt;     (readP_to_S p s ++ readP_to_S q s)

&gt; prop_LeftPlus p q s =
&gt;   readP_to_S (p &lt;++ q) s =~
&gt;     (readP_to_S p s +&lt;+ readP_to_S q s)
&gt;  where
&gt;   [] +&lt;+ ys = ys
&gt;   xs +&lt;+ _  = xs

&gt; prop_Gather s =
&gt;   forAll readPWithoutReadS $ \p -&gt;
&gt;     readP_to_S (gather p) s =~
&gt;       [ ((pre,x::Int),s')
&gt;       | (x,s') &lt;- readP_to_S p s
&gt;       , let pre = take (length s - length s') s
&gt;       ]

prop&gt; \this str -&gt; readP_to_S (string this) (this ++ str) == [(this,str)]

&gt; prop_String_Maybe this s =
&gt;   readP_to_S (string this) s =~
&gt;     [(this, drop (length this) s) | this `isPrefixOf` s]

&gt; prop_Munch p s =
&gt;   readP_to_S (munch p) s =~
&gt;     [(takeWhile p s, dropWhile p s)]

&gt; prop_Munch1 p s =
&gt;   readP_to_S (munch1 p) s =~
&gt;     [(res,s') | let (res,s') = (takeWhile p s, dropWhile p s), not (null res)]

&gt; prop_Choice ps s =
&gt;   readP_to_S (choice ps) s =~
&gt;     readP_to_S (foldr (+++) pfail ps) s

&gt; prop_ReadS r s =
&gt;   readP_to_S (readS_to_P r) s =~ r s
-}</span><span>
</span><span id="line-505"></span></pre></body></html>